package cn.sciento.transfer.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.validator.constraints.NotBlank;
import cn.sciento.starter.keyencrypt.core.Encrypt;

@ApiModel("表结构变更日志")
@VersionAudit
@ModifyAudit
@Table(name = "hdtt_db_migration_log")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DbMigrationLog extends AuditDomain {
  public static final String ENCRYPT_KEY = "cn.sciento.transfer.domain.entity.DbMigrationLog";
  
  public static final String FIELD_DB_MIGRATION_LOG_ID = "dbMigrationLogId";
  
  public static final String FIELD_SOURCE_SERVICE = "sourceService";
  
  public static final String FIELD_SOURCE_DS_ID = "sourceDsId";
  
  public static final String FIELD_SOURCE_DS = "sourceDs";
  
  public static final String FIELD_SOURCE_DB = "sourceDb";
  
  public static final String FIELD_SOURCE_TABLE = "sourceTable";
  
  public static final String FIELD_TARGET_SERVICE = "targetService";
  
  public static final String FIELD_TARGET_DS_ID = "targetDsId";
  
  public static final String FIELD_TARGET_DS = "targetDs";
  
  public static final String FIELD_TARGET_DB = "targetDb";
  
  public static final String FIELD_TARGET_TABLE = "targetTable";
  
  public static final String FIELD_MESSAGES = "messages";
  
  public static final String FIELD_PROCESS_STATUS = "processStatus";
  
  public static final String FIELD_PROCESS_MSG = "processMsg";
  
  public static final String FIELD_PROCESS_TIME = "processTime";
  
  @Encrypt
  @ApiModelProperty("表ID，主键")
  @Id
  @GeneratedValue
  private Long dbMigrationLogId;
  
  @ApiModelProperty(value = "服务名", required = true)
  @NotBlank
  private String sourceService;
  
  @ApiModelProperty("数据源ID")
  private Long sourceDsId;
  
  @ApiModelProperty("数据源编码")
  private String sourceDs;
  
  @ApiModelProperty("DB编码")
  private String sourceDb;
  
  @ApiModelProperty(value = "处理表，也是消息TOPIC", required = true)
  @NotBlank
  private String sourceTable;
  
  @ApiModelProperty("目标服务名")
  private String targetService;
  
  @ApiModelProperty("数据源ID")
  private Long targetDsId;
  
  @ApiModelProperty("数据源编码")
  private String targetDs;
  
  @ApiModelProperty("DB编码")
  private String targetDb;
  
  @ApiModelProperty("消费对应的表，默认跟消息生产表一样")
  private String targetTable;
  
  @ApiModelProperty("消息内容")
  private String messages;
  
  @ApiModelProperty(value = "处理状态，参考：HDTT.EVENT_PROCESS_STATUS", required = true)
  @NotBlank
  private String processStatus;
  
  @ApiModelProperty("处理消息")
  private String processMsg;
  
  @ApiModelProperty("处理时间")
  private Date processTime;
  
  @Transient
  private Long producerConfigId;
  
  public Long getDbMigrationLogId() {
    return this.dbMigrationLogId;
  }
  
  public void setDbMigrationLogId(Long dbMigrationLogId) {
    this.dbMigrationLogId = dbMigrationLogId;
  }
  
  public String getSourceService() {
    return this.sourceService;
  }
  
  public void setSourceService(String sourceService) {
    this.sourceService = sourceService;
  }
  
  public Long getSourceDsId() {
    return this.sourceDsId;
  }
  
  public void setSourceDsId(Long sourceDsId) {
    this.sourceDsId = sourceDsId;
  }
  
  public String getSourceDs() {
    return this.sourceDs;
  }
  
  public void setSourceDs(String sourceDs) {
    this.sourceDs = sourceDs;
  }
  
  public String getSourceDb() {
    return this.sourceDb;
  }
  
  public void setSourceDb(String sourceDb) {
    this.sourceDb = sourceDb;
  }
  
  public String getSourceTable() {
    return this.sourceTable;
  }
  
  public void setSourceTable(String sourceTable) {
    this.sourceTable = sourceTable;
  }
  
  public String getTargetService() {
    return this.targetService;
  }
  
  public void setTargetService(String targetService) {
    this.targetService = targetService;
  }
  
  public Long getTargetDsId() {
    return this.targetDsId;
  }
  
  public void setTargetDsId(Long targetDsId) {
    this.targetDsId = targetDsId;
  }
  
  public String getTargetDs() {
    return this.targetDs;
  }
  
  public void setTargetDs(String targetDs) {
    this.targetDs = targetDs;
  }
  
  public String getTargetDb() {
    return this.targetDb;
  }
  
  public void setTargetDb(String targetDb) {
    this.targetDb = targetDb;
  }
  
  public String getTargetTable() {
    return this.targetTable;
  }
  
  public void setTargetTable(String targetTable) {
    this.targetTable = targetTable;
  }
  
  public String getMessages() {
    return this.messages;
  }
  
  public void setMessages(String messages) {
    this.messages = messages;
  }
  
  public String getProcessStatus() {
    return this.processStatus;
  }
  
  public void setProcessStatus(String processStatus) {
    this.processStatus = processStatus;
  }
  
  public String getProcessMsg() {
    return this.processMsg;
  }
  
  public void setProcessMsg(String processMsg) {
    this.processMsg = processMsg;
  }
  
  public Date getProcessTime() {
    return this.processTime;
  }
  
  public void setProcessTime(Date processTime) {
    this.processTime = processTime;
  }
  
  public Long getProducerConfigId() {
    return this.producerConfigId;
  }
  
  public DbMigrationLog setProducerConfigId(Long producerConfigId) {
    this.producerConfigId = producerConfigId;
    return this;
  }
}
